home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CIconBuddy / CIconBuddy.h < prev   
Encoding:
C/C++ Source or Header  |  1994-11-30  |  1.9 KB  |  75 lines  |  [TEXT/KAHL]

  1. /* CIconBuddy.c
  2.  *    An icon pane/button class based on the System 7 icon buddy calls that
  3.  *    draw/track icon suites.  See Tech Note M.IM.IconDrawing for more details.
  4.  *
  5.  *    SUPERCLASS = CPane.c
  6.  *
  7.  *    Copyright ©1992, Mark/Space Softworks, All Rights Reserved
  8.  *
  9.  *    This class is buyware, if you use it, buy a Mark/Space Softworks product.
  10.  *    Send email to one of the below addresses for more details.
  11.  *        Internet:    mspace@netcom.com
  12.  *        AppleLink:    MARKSPACE
  13.  *        AOL:        markspace
  14.  *    
  15.  *    12/12/92    bhall    Created
  16.  *    12/14/92    bhall    Cleaned up for submission to TCL-TALK
  17.  */
  18.  
  19. #pragma once
  20.  
  21. #include <CPane.h>
  22. #include <Icons.h>
  23.  
  24. class CIconBuddy : public CPane {    
  25.  
  26. public:
  27.  
  28.     void     IIconBuddy(
  29.                 CView *anEnclosure, CBureaucrat *aSupervisor,
  30.                 short awidth, short aHeight,
  31.                 short aHEncl, short aVEncl,
  32.                 SizingOption aHSizing, SizingOption aVSizing,
  33.                 short iconID, Boolean fPreferColor);
  34.                     
  35.     virtual    void     IViewTemp(
  36.                 CView *anEnclosure, CBureaucrat *aSupervisor, Ptr viewData);
  37.  
  38.     virtual    void    Activate(void);
  39.     virtual    void    Deactivate(void);
  40.  
  41.     virtual    void    SetIconID(short anID);
  42.     virtual    short    GetIconID(void);
  43.     
  44.     virtual    void                SetAlignment(IconAlignmentType anAlign);
  45.     virtual    IconAlignmentType    GetAlignment(void);
  46.  
  47.     virtual    void     Draw(Rect *area);
  48.     
  49.     virtual    void    SimulateClick(void);
  50.     virtual    void     DoClick(Point hitPt, short modifierKeys, long when);
  51.  
  52.     virtual    void     SetClickCmd(long aCmd);
  53.     virtual    long     GetClickCmd(void);
  54.     
  55. protected:
  56.     short                iconID;        // ID of the family to use
  57.     long                clickCmd;    // Command to send on a good click
  58.     IconAlignmentType    align;
  59.     Boolean                allowDistortion;
  60.     static RgnHandle    cIconRgn;
  61.     
  62.     virtual    void    IIconBuddyX(Boolean fPreferColor);    
  63.     virtual    void    GetIconRect(Rect *theRect);
  64.     virtual    void     DrawIcon(Boolean fHilite);                
  65.     virtual    Boolean Track(void);
  66. };
  67.  
  68.  
  69. typedef struct tIconPaneTemp {
  70.     PaneTemp    paneTemp;
  71.     short        iconID;
  72.     short        fPreferColor;
  73.     long        clickCmd;
  74. } tIconPaneTemp, *tIconPaneTempP;
  75.